var Mock =require('mockjs');
var lodash =require('lodash');
var faker =require('faker');

/* http://localhost:3000/news?_page=1&_limit=3&_sort=id&_order=desc */
module.exports = function(){
    return {
        product:lodash.times(100,function(n){
            return {
                id:n,
                name:Mock.Random.ctitle( 2, 5 ),
                img:faker.random.image(),
                // img:faker.random.image("200x100"),
                content:Mock.Random.csentence( 6, 17 ),
                time:Mock.Random.datetime('yyyy-MM-dd A HH:mm:ss'),
                price:Math.ceil(Math.random()*100)
            }
        }),
        news:lodash.times(100,function(n){
            return {
                id:n,
                author:Mock.Random.ctitle( 2, 3 ),
                title:Mock.Random.ctitle( 2, 5 ),
                content:Mock.Random.cparagraph( 2, 20 ),
                time:Mock.Random.datetime('yyyy-MM-dd HH:mm:ss'),
            }
        })
    }

}